package com.dianrui.operation.view;

import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.MotionEvent;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.dianrui.operation.R;


/**
 * Created by leilei on 2018/4/23.
 */

public class BaiduCenterPoint extends LinearLayout{
    public BaiduCenterPoint(Context context) {
        super(context);init(context);
    }

    public BaiduCenterPoint(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);init(context);
    }

    public BaiduCenterPoint(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);init(context);
    }

    private void init(Context context){
        this.setGravity(Gravity.CENTER);
       ImageView imageview=new ImageView(context);

        this.addView(imageview);
        imageview.setLayoutParams(new LayoutParams(100,100));
        imageview.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
        imageview.setImageResource(R.mipmap.center);
    }




    @Override
    public boolean onTouchEvent(MotionEvent event) {
        return false;
    }
}
